//
// Created by yan on 6/29/17.
//

#ifndef MIPSTEST_BSYSNODE_H
#define MIPSTEST_BSYSNODE_H

#include <iostream>
#include <map>

class bSysNode {

public:
    virtual int initcfg();

    virtual int start();

    virtual int end();

    virtual void * getIstance(){ return NULL;}

    void * getIstance(std::string name){
        auto exportNode = (*pList).find(name);
        if(exportNode == (*pList).end())
            throw "get node filed!" ;

        return exportNode->second->getIstance();
    }

    void setpList(std::map<std::string ,bSysNode*> *list){
        pList = list;
    }

    std::string getNodeName(){ return m_strName;}
    bSysNode(std::string);
protected:
    bSysNode();
    std::string m_strName;
    std::map<std::string ,bSysNode*> *pList;
private:

};


#endif //MIPSTEST_BSYSNODE_H
